home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1989 …il & Dave's Excellent CD / Excellent CD HFS.raw / Moof / Goodies / MPW Goodies / Interfaces / CIncludes / Dialogs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-11-30  |  5.1 KB  |  187 lines  |  [TEXT/MPS ]

  1. /************************************************************
  2.  
  3. Created: Tuesday, October 4, 1988 at 5:38 PM
  4.     Dialogs.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.     Copyright Apple Computer, Inc.   1985-1988
  9.     All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __DIALOGS__
  15. #define __DIALOGS__
  16.  
  17. #ifndef __WINDOWS__
  18. #include <Windows.h>
  19. #endif
  20.  
  21. #ifndef __TEXTEDIT__
  22. #include <TextEdit.h>
  23. #endif
  24.  
  25. #define ctrlItem 4
  26. #define btnCtrl 0
  27. #define chkCtrl 1
  28. #define radCtrl 2
  29. #define resCtrl 3
  30. #define statText 8
  31. #define editText 16
  32. #define iconItem 32
  33. #define picItem 64
  34. #define userItem 0
  35. #define itemDisable 128
  36. #define ok 1
  37. #define cancel 2
  38. #define stopIcon 0
  39. #define noteIcon 1
  40. #define cautionIcon 2
  41.  
  42. typedef short StageList;
  43.  
  44. typedef WindowPtr DialogPtr;
  45.  
  46. typedef pascal void (*ResumeProcPtr)(void);
  47. typedef pascal void (*SoundProcPtr)(void);
  48. typedef pascal Boolean (*ModalFilterProcPtr)(DialogPtr theDialog, EventRecord *theEvent, short *itemHit);
  49.  
  50.  
  51. struct DialogRecord {
  52.     WindowRecord window;
  53.     Handle items;
  54.     TEHandle textH;
  55.     short editField;
  56.     short editOpen;
  57.     short aDefItem;
  58. };
  59.  
  60. #ifndef __cplusplus
  61. typedef struct DialogRecord DialogRecord;
  62. #endif
  63.  
  64. typedef DialogRecord *DialogPeek;
  65.  
  66. struct DialogTemplate {
  67.     Rect boundsRect;
  68.     short procID;
  69.     Boolean visible;
  70.     Boolean filler1;
  71.     Boolean goAwayFlag;
  72.     Boolean filler2;
  73.     long refCon;
  74.     short itemsID;
  75.     Str255 title;
  76. };
  77.  
  78. #ifndef __cplusplus
  79. typedef struct DialogTemplate DialogTemplate;
  80. #endif
  81.  
  82. typedef DialogTemplate *DialogTPtr, **DialogTHndl;
  83.  
  84. struct AlertTemplate {
  85.     Rect boundsRect;
  86.     short itemsID;
  87.     StageList stages;
  88. };
  89.  
  90. #ifndef __cplusplus
  91. typedef struct AlertTemplate AlertTemplate;
  92. #endif
  93.  
  94. typedef AlertTemplate *AlertTPtr, **AlertTHndl;
  95.  
  96. #ifdef __safe_link
  97. extern "C" {
  98. #endif
  99. pascal void InitDialogs(ResumeProcPtr resumeProc)
  100.     = 0xA97B; 
  101. pascal void ErrorSound(SoundProcPtr soundProc)
  102.     = 0xA98C; 
  103. pascal DialogPtr NewDialog(Ptr wStorage,const Rect *boundsRect,const Str255 title,
  104.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  105.     Handle itmLstHndl)
  106.     = 0xA97D; 
  107. DialogPtr newdialog(Ptr wStorage,const Rect *boundsRect,char *title,Boolean visible,
  108.     short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,Handle itmLstHndl); 
  109. pascal DialogPtr GetNewDialog(short dialogID,Ptr dStorage,WindowPtr behind)
  110.     = 0xA97C; 
  111. pascal void CloseDialog(DialogPtr theDialog)
  112.     = 0xA982; 
  113. pascal void DisposDialog(DialogPtr theDialog)
  114.     = 0xA983; 
  115. pascal void CouldDialog(short dialogID)
  116.     = 0xA979; 
  117. pascal void FreeDialog(short dialogID)
  118.     = 0xA97A; 
  119. pascal void ParamText(const Str255 param0,const Str255 param1,const Str255 param2,
  120.     const Str255 param3)
  121.     = 0xA98B; 
  122. pascal void ModalDialog(ModalFilterProcPtr filterProc,short *itemHit)
  123.     = 0xA991; 
  124. pascal Boolean IsDialogEvent(const EventRecord *theEvent)
  125.     = 0xA97F; 
  126. pascal Boolean DialogSelect(const EventRecord *theEvent,DialogPtr *theDialog,
  127.     short *itemHit)
  128.     = 0xA980; 
  129. pascal void DrawDialog(DialogPtr theDialog)
  130.     = 0xA981; 
  131. pascal void UpdtDialog(DialogPtr theDialog,RgnHandle updateRgn)
  132.     = 0xA978; 
  133. pascal short Alert(short alertID,ModalFilterProcPtr filterProc)
  134.     = 0xA985; 
  135. pascal short StopAlert(short alertID,ModalFilterProcPtr filterProc)
  136.     = 0xA986; 
  137. pascal short NoteAlert(short alertID,ModalFilterProcPtr filterProc)
  138.     = 0xA987; 
  139. pascal short CautionAlert(short alertID,ModalFilterProcPtr filterProc)
  140.     = 0xA988; 
  141. pascal void CouldAlert(short alertID)
  142.     = 0xA989; 
  143. pascal void FreeAlert(short alertID)
  144.     = 0xA98A; 
  145. pascal void GetDItem(DialogPtr theDialog,short itemNo,short *itemType,Handle *item,
  146.     Rect *box)
  147.     = 0xA98D; 
  148. pascal void SetDItem(DialogPtr theDialog,short itemNo,short itemType,Handle item,
  149.     const Rect *box)
  150.     = 0xA98E; 
  151. pascal void HideDItem(DialogPtr theDialog,short itemNo)
  152.     = 0xA827; 
  153. pascal void ShowDItem(DialogPtr theDialog,short itemNo)
  154.     = 0xA828; 
  155. pascal void SelIText(DialogPtr theDialog,short itemNo,short strtSel,short endSel)
  156.     = 0xA97E; 
  157. pascal void GetIText(Handle item,Str255 text)
  158.     = 0xA990; 
  159. pascal void SetIText(Handle item,const Str255 text)
  160.     = 0xA98F; 
  161. pascal short FindDItem(DialogPtr theDialog,Point thePt)
  162.     = 0xA984; 
  163. pascal DialogPtr NewCDialog(Ptr dStorage,const Rect *boundsRect,const Str255 title,
  164.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  165.     Handle items)
  166.     = 0xAA4B; 
  167. DialogPtr newcdialog(Ptr dStorage,const Rect *boundsRect,char *title,Boolean visible,
  168.     short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,Handle items); 
  169. pascal short GetAlrtStage(void)
  170.     = {0x3EB8,0x0A9A}; 
  171. pascal void ResetAlrtStage(void)
  172.     = {0x4278,0x0A9A}; 
  173. pascal void DlgCut(DialogPtr theDialog); 
  174. pascal void DlgPaste(DialogPtr theDialog); 
  175. pascal void DlgCopy(DialogPtr theDialog); 
  176. pascal void DlgDelete(DialogPtr theDialog); 
  177. pascal void SetDAFont(short fontNum); 
  178. void paramtext(char *param0,char *param1,char *param2,char *param3); 
  179. void getitext(Handle item,char *text); 
  180. void setitext(Handle item,char *text); 
  181. short findditem(DialogPtr theDialog,Point *thePt); 
  182. #ifdef __safe_link
  183. }
  184. #endif
  185.  
  186. #endif
  187.